<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <style>
            #app div {
                width: 100px;
                height: 100px;
                border: 1px solid #000;
            }
            .redDiv {
                background: red;
            }
            #app .borderDiv {
                border: 3px dashed #000;
            }
        </style>
    </head>
    <body>
        <div id="app">
            <img v-bind:src="imgSrc"   alt="" />
            <!-- <div :class="{redDiv: isRed}">Hello....Nanchang</div> -->
            <!-- <div :class="[classA]">Hello....Nanchang</div> -->
            <div 
                :class="['redDiv',{borderDiv: isBorderDiv}]" 
                :style="{ fontSize: size }">
                Hello....Nanchang
            </div>
            <button @click="handleClick">变变变</button>
        </div>
        <script src="../vue.js"></script>
        <script>
            new Vue({
                el: '#app',
                data: {
                    imgSrc: '../google.png',
                    isRed: true,
                    classA: 'redDiv',
                    isBorderDiv: false,
                    // borderDiv: false,
                    size: '22px',
                },
                methods: {
                    handleClick() {
                        this.imgSrc = '../i.jpg';
                        this.isRed = !this.isRed;
                        this.isBorderDiv = true;
                        console.log(this);
                    },
                },
            });
        </script>
    </body>
</html>
